---
title: "tbody foreach · RUAL Documentation"
description: "Serves as a dynamic container, generating an unique tbody for each element in the specified array."
canonical: https://docs.rual.nl/block-types/state ui/state_foreach_tbody
language: en
---

# tbody foreach

This block is part of the [`state ui`](https://docs.rual.nl/block-types/state%20ui) group and was last modified in core [`v13.0.4`](https://docs.rual.nl/core-versions/130004).

### Type Selection Required

This block requires you to select the data type you want to work with. You must manually select the type using the type selector modal. To access the modal, click the white button on the block.

Serves as a dynamic container, generating an unique `tbody` for each element in the specified array.

- array required `array` This array is the source of data for generating the individual tbody elements. • Hidden when other fields are filled

- state key required `v13.0.4` `value` This state key is the source of data for generating the individual div elements. • Hidden when other fields are filled

- class `uiclass` Assigns a CSS class to the element. • Hidden when unused

- style `uistyle` Applies inline CSS style to the element • Hidden when unused

- attributes `uiattributes` Adds custom attributes to the element. • Hidden when unused

- state `state` Returns the element to the frontend state.

- iterator `execute_function`

A typical wiring for [tbody foreach](https://docs.rual.nl/block-types/state%20ui/state_foreach_tbody): [with values](https://docs.rual.nl/block-types/array/array_of_values) feeds the `array` pin; [value](https://docs.rual.nl/block-types/value/value_default) feeds the `state` pin; the function out pin wires to an [execute](https://docs.rual.nl/block-types/function%20execution/function_custom_execute_from_trigger) block.

![Studio canvas example for the tbody foreach block: typical wiring for tbody foreach.](https://docs.rual.nl/canvas-examples/state_foreach_tbody.png)

### Version history

Introduced in [`v13.0.4`](https://docs.rual.nl/core-versions/130004).
